Onion Architecture 2008
Jeffrey Palermoによる
This architecture is not appropriate for small websites. It is appropriate for long-lived business applications as well as applications with complex behavior.
It emphasizes the use of interfaces for behavior contracts, and it forces the externalization of infrastructure.
https://i0.wp.com/jeffreypalermo.com/wp-content/uploads/2018/06/image257b0257d255b59255d.png?resize=366%2C259&ssl=1
中央にDomain Model
その外側にDomain Services
さらに外側にApplication Services
一番外側に
User Interfaces
Infrastructures
Tests
The main premise is that it controls coupling.
The fundamental rule is that all code can depend on layers more central, but code cannot depend on layers further out from the core.
内側に依存
remember that the Domain Model is the very center
since all coupling is toward the center, the Domain Model is only coupled to itself.
このあたりから積ん読
The Onion Architecture relies heavily on the Dependency Inversion principle.
The database is not the center. It is external.
Hexagonal Architectureへのリンクもある